Dynomotion

Group: DynoMotion Message: 2197 From: himykabibble Date: 11/12/2011
Subject: KMotionCNC Keyboard Mapping
It's been a looooong time since I've so much as looked at any Windows GUI code that didn't take advantage of high-level tools (Delphi, C++Builder, etc.), and I seem to be completely lost in terms of understanding how keyboard events get mapped to events in KMotionCNC. I want to add some additional keyboard events, but don't have a clue where to start. I've tried to figure it out by looking at how the jog keys work, but so far I'm still groping in the dark. Can someone point me in the right direction? I see where the jogging actually takes place in CMotionButton, but I can't see how we get there....

Regards,
Ray L.
Group: DynoMotion Message: 2198 From: Tom Kerekes Date: 11/12/2011
Subject: Re: KMotionCNC Keyboard Mapping
Hi Ray,
 
Yes it isn't easy in C++ MFC.
 
There is a Keyboard hook function called
 
KbdProc()
 
which calls
 
DoCheckShiftAndKey()
 
to handle the Jog events.
 
Then there are message maps for certain keys.
 
ON_COMMAND(ID_ESC, OnESC)
ON_COMMAND(ID_F2, OnF2)
ON_COMMAND(ID_F3, OnBnClickedFeedhold)
 
 
BTW I'm not sure exactly what you are doing but we're adding a mechanism for KFLOP to send "events" up to the PC (KMotionCNC) that should be helpful for things like external buttons like Halt and Cycle Start for example.  Jog buttons aren't included though because it is better to do things like jogging entirely within KFLOP which doesn't involve Windows uncertainties.  Most users have an MPG connected directly to KFLOP.  There will be an experimental release within the next couple of days it mainly just need to be documented.  BTW It also includes the method of parameters you suggested for MCodes.  It allows using P Q R words as parameters. 
 
Regards
TK
 
 
 
Group: DynoMotion Message: 2199 From: himykabibble Date: 11/12/2011
Subject: Re: KMotionCNC Keyboard Mapping
Tom,

Thanks. Those all sound like very handy improvements. Can't wait!

What I want to do, eventually, is have an external control panel for most common operations, rather than having to use the PC as the interfaces. Under Mach3, I can do this easily with a PoKeys, which can generate either keypresses, or Mach I/O events. I suspect with KMotionCNC I could do what I want entirely with keyboard events, but obviously mapping them is not as easy as it is in Mach3.

BTW - Are the digital I/Os pulled down? I've got some switches connected to several inputs, with the switches going to +3.3V when pressed. I'm finding the I/Os very noisy. I'm sure I would be better if they were pulled up, with the switches grounding the I/Os, but this was just easier to do quickly for playing around.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> Yes it isn't easy in C++ MFC.
>  
> There is a Keyboard hook function called
>  
> which calls
>  DoCheckShiftAndKey()
>  
> to handle the Jog events.
>  
> Then there are message maps for certain keys.
>  ON_COMMAND(ID_ESC, OnESC)
> ON_COMMAND(ID_F2, OnF2)
> ON_COMMAND(ID_F3, OnBnClickedFeedhold)
>  
>  
> BTW I'm not sure exactly what you are doing but we're adding a mechanism for KFLOP to send "events" up to the PC (KMotionCNC) that should be helpful for things like external buttons like Halt and Cycle Start for example.  Jog buttons aren't included though because it is better to do things like jogging entirely within KFLOP which doesn't involve Windows uncertainties.  Most users have an MPG connected directly to KFLOP.  There will be an experimental release within the next couple of days it mainly just need to be documented.  BTW It also includes the method of parameters you suggested for MCodes.  It allows using P Q R words as parameters. 
>  
> Regards
> TK
>  
>  
>  
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Saturday, November 12, 2011 4:16 PM
> Subject: [DynoMotion] KMotionCNC Keyboard Mapping
>
>
>  
> It's been a looooong time since I've so much as looked at any Windows GUI code that didn't take advantage of high-level tools (Delphi, C++Builder, etc.), and I seem to be completely lost in terms of understanding how keyboard events get mapped to events in KMotionCNC. I want to add some additional keyboard events, but don't have a clue where to start. I've tried to figure it out by looking at how the jog keys work, but so far I'm still groping in the dark. Can someone point me in the right direction? I see where the jogging actually takes place in CMotionButton, but I can't see how we get there....
>
> Regards,
> Ray L.
>
>
>
>
>
>  
> KbdProc()
>
Group: DynoMotion Message: 2200 From: Tom Kerekes Date: 11/12/2011
Subject: Re: KMotionCNC Keyboard Mapping
Hi Ray,
 
The first 8 IO on the Aux0 and Aux1 connectors have 150 ohm termination (pull down).  The rest are floating and very high impedance (meg ohms).
 
Regards
TK